chore: Upgrade to eslint9#733
Conversation
bingenito
commented
May 2, 2025
- Introduced ESLint9 configuration file with rules and license header enforcement.
- Added license header to missing files via lint:fix
- Configured ESLint to ignore specific directories and files, including build artifacts and configuration files.
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the ESLint configuration to ESLint9, enforces license headers across the codebase, and configures ESLint to ignore build artifacts and non-essential files. Key changes include the introduction of a new ESLint configuration file (eslint.config.mjs), the addition of license headers to several source and test files, and minor refactoring for improved clarity.
Reviewed Changes
Copilot reviewed 10 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/desktopjs/vite.config.ts | Added license header to the Vite configuration file |
| packages/desktopjs/tests/setup.ts | Added license header to the test setup file |
| packages/desktopjs-openfin/vite.config.ts | Added license header to the OpenFin Vite configuration file |
| packages/desktopjs-openfin/tests/openfin.spec.ts | Minor type refinements in event listener parameter definitions |
| packages/desktopjs-openfin/src/openfin.ts | Refactored getState to use an explicit if/else block |
| packages/desktopjs-electron/vite.config.ts | Added license header to the Electron Vite configuration file |
| packages/desktopjs-electron/tests/setup.ts | Added license header to the Electron test setup file |
| eslint.config.mjs | New ESLint configuration with license header enforcement |
| README.md | Updated documentation with linting instructions |
Files not reviewed (3)
- .eslintrc.json: Language not supported
- package.json: Language not supported
- tsconfig.test.json: Language not supported
Comments suppressed due to low confidence (1)
eslint.config.mjs:17
- Confirm that the LICENSE_HEADER array accurately reflects the required Apache License 2.0 header; consider referencing an external license file if the header text might evolve over time.
const LICENSE_HEADER = [
| return new Promise<any>(resolve => { | ||
| (this.nativeWindow && (<any>this.nativeWindow).getState) ? resolve((<any>this.nativeWindow).getState()) : resolve(undefined); | ||
| // Use explicit if/else instead of ternary for side-effect | ||
| if (this.nativeWindow && (<any>this.nativeWindow).getState) { |
There was a problem hiding this comment.
[nitpick] The explicit if/else block improves clarity compared to the condensed ternary operator; ensure this change aligns with the project's coding style and consider adding an inline comment to explain its purpose if necessary.